local weili = fk.CreateSkill {
  name = "th_weili",
  tags = { Skill.Compulsory },
}

weili:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(weili.name) and data.card and data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = data.to
    local card = {}
    if not to:isKongcheng() then
      card = room:askToCards(to, {
        min_num = 1,
        max_num = 1,
        include_equip = false,
        skill_name = weili.name,
        cancelable = true,
        pattern = ".|.|black",
        prompt = "#th_weili_give:" .. player.id
      })
    end
    if #card > 0 then
      room:obtainCard(player, card, false, fk.ReasonGive, data.to)
    else
      data:setDisresponsive(to)
    end
  end,
})

Fk:loadTranslationTable{
  ["th_weili"] = "围篱",
  [":th_weili"] = "锁定技，当你使用【杀】指定目标后，其选择一项：1.交给你一张黑色手牌；2.不可响应此【杀】。",

  ["#th_weili_give"] = "围篱：你需交给 %src 一张黑色手牌，否则你不可响应此【杀】",
}

return weili